<?php
// +----------------------------------------------------------------------
// | Author: wyd 2025/11/4
// | DESC: 
// +----------------------------------------------------------------------

declare (strict_types=1);

$timerId = swoole_timer_tick(1000, function () {
    echo "定时器触发: " . date('H:i:s') . "\n";
});

\Co\run(function () use ($timerId) {
    go(function () use ($timerId) {
        co::sleep(5);
        echo $timerId;
        swoole_timer_clear($timerId);
    });
});



